<%@ page contentType="text/html;charset=utf-8"%>
<%@page import="com.leruan.aasimp.entity.Board"%>
<%@page import="java.util.*"%>
<%@page import="com.leruan.aasimp.dao.MainPostDao"%>
<%@page import="com.leruan.aasimp.entitydto.MainPostDto"%>
<%@page import="com.leruan.aasimp.entitydto.ReplyDto"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
List<Board> boards = (List<Board>)request.getAttribute("boards");
 Map<String, String> map = (Map<String, String>)request.getAttribute("map");
 String postOrReply = request.getParameter("postOrReply");
 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="<%=path %>/mok/forum/admin/style/admin.css" type=text/css rel=stylesheet></LINK>
<SCRIPT src="../../forum/js/common.js" type=text/javascript></SCRIPT>
<SCRIPT src="../admin/js/admin.js" type=text/javascript></SCRIPT>
<script type="text/javascript" language="javascript" src="<%=path%>/mok/forum/admin/js/utils.js"></script>
<script type="text/javascript" language="javascript">
	function hide(){
        var theTable = document.getElementById("postTitle");
         theTable.style.display = 'none';
	}
	function show(){
        var theTable = document.getElementById("postTitle");
         theTable.style.display = 'block';	
	}
</script>
</HEAD>
<BODY topMargin=10>
<TABLE cellSpacing=6 cellPadding=2 width="100%" border=0>
  <TBODY>
  <TR>
    <TD>
      <TABLE class=guide cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD><A onclick="parent.location='../index.htm';return false;" 
            href="#">后台管理首页</A>&nbsp;&raquo;&nbsp;批量删帖</TD></TR></TBODY></TABLE><BR>
      <TABLE class=info_tb cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR class=header>
          <TD>
            <DIV style="FLOAT: left; MARGIN-LEFT: 0px; PADDING-TOP: 8px">技巧提示</DIV>
            <DIV style="FLOAT: right; PADDING-BOTTOM: 9px; MARGIN-RIGHT: 4px"></DIV></TD></TR>
        <TBODY id=menu_tip>
        <TR>
          <TD>
            <UL>
              <LI>批量删帖一般用于删除违规的回复内容和帖子</LI>
		    </UL></TD></TR></TBODY></TABLE>
      <FORM id="frmsearch" name="frmsearch"  action="batchRemovePost" method="get">
      <TABLE id="search" class=info_tb cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR class=header>
          <TD colSpan=2>帖子查询</TD></TR>
        <tr>
        <td class=altbg1 colSpan=2>
           <s:actionerror cssStyle="color:red"/>
           <s:actionmessage cssStyle="color:green"/>
        </td>
        </tr>
        <TR>
          <TD class=altbg1>所在版块:</TD>
          <TD class=altbg2 align=right>
		              <select id="boardId" name="boardId">
                  <%
                  String boardId  = map.get("boardId");
                  for(Board b:boards){
                  String selected  = b.getBoardId().equals(boardId)?" selected=\"selected\"" : "";
                  %>
                     <option value="<%=b.getBoardId() %>" <%=selected %>><%=b.getBoardName() %></option>
                  
                  <%
                  }
                   %>
            </select></TD></TR>
        <TR>
          <TD class=altbg1>发帖用户名:</TD>
          <TD class=altbg2 align=right><INPUT size=40 name="username" value="<%=null==map.get("username")?"":map.get("username") %>"></TD></TR>
        <TR>
          <TD class=altbg1>所属主题的标题关键字:</TD>
          <TD class=altbg2 align=right><INPUT size=40 name="postTitle" id="postTitle" value="<%=null==map.get("postTitle")?"":map.get("postTitle") %>"></TD></TR>
        <TR>
          <TD class=altbg1>发帖日期晚于(yyyy-mm-dd):</TD>
          <TD class=altbg2 align=right>
          <input name="postDateStart"  id="postDateStart" type="text" size="10" maxlength="10" value="<%=null==map.get("postDateStart")?"":map.get("postDateStart") %>" />
          <a href="javascript:void(0)" onclick="gfPop.fPopCalendar(document.frmsearch.postDateStart);return false;" hidefocus="hidefocus">
          <img name="popcal" align="absmiddle" src="<%=path %>/calendar/calbtn.gif" width="34" height="22" border="0" alt="发帖日期晚于" /></a>
          </TD></TR>
        <TR>
          <TD class=altbg1>发帖日期早于(yyyy-mm-dd):</TD>
          <TD class=altbg2 align=right>
          <input name="postDateEnd"  id="postDateEnd" type="text" size="10" maxlength="10" value="<%=null==map.get("postDateEnd")?"":map.get("postDateEnd") %>" />
          <a href="javascript:void(0)" onclick="gfPop.fPopCalendar(document.frmsearch.postDateEnd);return false;" hidefocus="hidefocus">
          <img name="popcal" align="absmiddle" src="<%=path %>/calendar/calbtn.gif" width="34" height="22" border="0" alt="发帖日期早于" /></a>
          </TD></TR>
        <TR>
          <TD class=altbg1>查主贴or回复:</TD>
          <TD class=altbg2 align=right>
           <input  class="radio" type="radio" checked="<%="0".equals(postOrReply)?"checked":"" %>" value="0" name="postOrReply" onclick="show()"/> 主贴
            <input class="radio" type="radio" checked="<%="1".equals(postOrReply)?"checked":"" %>"  value="1" name="postOrReply" onclick="hide()"/> 回复 
             <INPUT class=button type=submit value="提 交" name=searchsubmit/>
          </TD></TR>
	  </TBODY></TABLE>
     </FORM>
     
     <TABLE class="info_tb" cellSpacing=0 cellPadding=0 width="100%" border=0>
	  <TBODY>
	  <TR class=header>
	    <TD></TD>
	    <TD>板块名称</TD>
	    <TD>主贴标题</TD>
	    <td>内容</td>
	    <TD>用户名</TD>
	    <TD>发帖/回复时间</TD>
	    </TR>
	    <%
	    if("1".equals(postOrReply)){
	    List<ReplyDto> replyListDto = (List<ReplyDto>)request.getAttribute("replyListDto");
	    for(ReplyDto dto:replyListDto){
	    %>
	        <tr align=middle>
	          <td></td>
              <td class=altbg1> <%=dto.getBoardName() %></td>
              <td class=altbg2><%=dto.getPostTitle() %></td>
              <td class="altbg1"><%=dto.getReplyContent() %></td>
              <td class="altbg2"><%=dto.getUsername() %></td>
              <td class="altbg1"><%=dto.getReplyDate() %></td>
            </tr>
	    <%
	    }
	    }else if("0".equals(postOrReply)){
	    List<MainPostDto> mainPostListDto = (List<MainPostDto> )request.getAttribute("mainPostListDto");
        for(MainPostDto dto:mainPostListDto){
	    %>
            <tr align=middle>
              <td></td>
              <td class="altbg1"><%=dto.getBoardName() %></td>
              <td class="altbg2"><%=dto.getPostTitle() %></td>
              <td class="altbg1"><%=dto.getContent() %></td>
              <td class="altbg2"><%=dto.getUserName() %></td>
              <td class="altbg1"><%=dto.getModifyDate() %></td>
            </tr>
	    <%
        }
	    }
	     %>
	    </TBODY></TABLE>
	    
	    <div class="pageNo" id="pageNo">
                <a href="batchRemovePostQuery?no=1&map=<%=map %>">首页</a>
                <c:if test="${sessionScope.pageNoSale != 1}">
                    <a href="batchRemovePostQuery?no=${sessionScope.pageNoSale-1}&map=<%=map %>">上一页</a>
                </c:if>
                <c:forEach var="i" begin="${sessionScope.pageNoCenterSale -2 }"
                    end="${sessionScope.pageNoCenterSale + 2}">
                    <c:if test="${i <= sessionScope.totalNoSale }">
                        <c:choose>
                            <c:when test="${i == sessionScope.pageNoSale}">
                                <a href="javascript:void(0)">${i}</a>
                            </c:when>
                            <c:otherwise>
                                <a href="batchRemovePostQuery?no=${i}&map=<%=map %>">${i}</a>
                            </c:otherwise>
                        </c:choose>
                    </c:if>
                </c:forEach>
                <c:if test="${sessionScope.pageNoSale +4 < sessionScope.totalNoSale}">
                    <a href="batchRemovePostQuery?no=${sessionScope.pageNoSale+1}&map=<%=map %>">下一页</a>
                </c:if>
                <a href="batchRemovePostQuery?no=${sessionScope.totalNoSale}&map=<%=map %>">末页</a>
                &nbsp;&nbsp;&nbsp;&nbsp;共有<label style="color: red;">${sessionScope.totalSale}</label>条信息
            </div>
	    
	    
     </TD></TR></TBODY></TABLE>
     
    
<iframe width="174" height="172" name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="<%=path %>/calendar/ipopeng.html" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; left:-500px; top:0px;"></iframe>
<script language="javascript">
</script>	  
</BODY></HTML>
